using System;
using System.Collections.Generic;
using System.Text;

namespace HongShijin.Database
{
    public class CSelectProcedure : CProcedure
    {
        //
        private SSelectProcedure _ = null;
        //
        public CSelectProcedure(string name) : base(name) { }
        public CSelectProcedure(string name, string alias) : base(name, alias) { }
        public CSelectProcedure(CDatabase_base db, string name) : base(db, name) { }
        public CSelectProcedure(CDatabase_base db, string name, string alias) : base(db, name, alias) { }
        //
		protected override void SetSchema()
        {
            this.SetSchema(new SSelectProcedure());
        }
        protected void SetSchema(SSelectProcedure s)
        {
            this._ = s;
            base.SetSchema(s);
        }
        //
        public IDataCommand GetCommand()
        {
            IDataCommand cmd = this.Database.CreateCommand();
            for (int i = 0; i < this._DataTable.Columns.Count; i++)
            {
                if (this._DataRow[i] != null && !this._DataRow[i].Equals(this._DataTable.Columns[i].DefaultValue))
                    cmd.AddField(this._DataTable.Columns[i], this._DataRow[i]);
            }
            return cmd;
        }
        //
    }
    //
    public class SSelectProcedure : SProcedure
    {
    }
    //
}
//
